package com.muyi.mapper;
import org.apache.ibatis.annotations.Param;

import com.muyi.pojo.entity.CategoryTag;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * @author VRMMO
 * @description 针对表【category_tag】的数据库操作Mapper
 * @createDate 2025-06-11 15:04:41
 * @Entity com.muyi.pojo.entity.CategoryTag
 */
@Mapper
public interface CategoryTagMapper extends BaseMapper<CategoryTag> {
    /**
     * 查询全部分类-标签
     * @return
     */
    @Select("select * from category_tag")
    List<CategoryTag> list();

    /**
     * 根据ID删除分类-标签
     * @param category_tag_id
     */
    @Delete("delete from category_tag where category_tag_id = #{category_tag_id}")
    void deleteById(Integer category_tag_id);

    /**
     * 新增分类-标签
     *
     * @param category_tag
     * @return
     */
    int insertAll(CategoryTag category_tag);


    /**
     * 更新分类-标签
     * @param category_tag
     */
    @Update("update category_tag set category_id=#{category_id}, tag_id=#{tag_id} where category_tag_id=#{category_tag_id}")
    void update(CategoryTag category_tag);

    @Select("select * from category_tag where category_tag_id = #{category_tag_id}")
    CategoryTag getByCategoryTagId(Integer category_tag_id);

}




